const dateFormat = (date) => {
    if (date instanceof Date) {
        const Y = date.getFullYear();
        const M = String(date.getMonth() + 1).padStart(2, '0');
        const D = String(date.getDate()).padStart(2, '0');
        return `${Y}-${M}-${D}`;
    }
};

module.exports = { dateFormat };
